package com.cf.docker.controller;

import com.cf.crudweb.controller.CommonController;
import com.cf.docker.model.Container;
import com.cf.docker.service.ContainerService;
import com.cf.vo.ResponseVo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * boot-awm-ContainerController
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/6/20 下午 02:52
 */
@RequestMapping("/container")
public class ContainerController extends CommonController<Container, ContainerService> {

    @Override
    protected String getPageDir() {
        return "container";
    }

    @ResponseBody
    @RequestMapping("/start")
    public ResponseVo<Boolean> startContainer(long containerId) {
        boolean b = this.getService().startContainer(containerId);
        return ResponseVo.success(b, "启动容器操作成功！");
    }

}
